/*
 * MIT License
 *
 * Copyright (c) 2024-2048 冰羽
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.xxl.adapter.entity;

import cn.star.framework.strategy.IdStrategyAutoincrementValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.xxl.adapter.core.XxlEntity;
import com.xxl.job.admin.core.model.XxlJobGroup;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.GenericGenerator;

/**
 * XxlJobGroup
 *
 * @author zhaoweiping
 *     <p style='color: red'>Created on 2024-09-23 11:06:00
 * @since 3.0.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "xxl_job_group")
@org.hibernate.annotations.Table(appliesTo = "xxl_job_group", comment = "执行器")
public class JobGroup extends XxlJobGroup implements XxlEntity {
  @Id
  @Column(name = "id", length = 11, nullable = false)
  @GeneratedValue(generator = IdStrategyAutoincrementValue.STRATEGY)
  @GenericGenerator(
      name = IdStrategyAutoincrementValue.STRATEGY,
      strategy = IdStrategyAutoincrementValue.STRATEGY)
  @JsonFormat(shape = Shape.STRING)
  @Comment(value = "主键")
  private int id;

  /** 执行器AppName */
  @Column(name = "app_name", length = 64, nullable = false)
  @Comment(value = "执行器AppName")
  private String appname;

  /** 执行器名称 */
  @Column(name = "title", length = 64, nullable = false)
  @Comment(value = "执行器名称")
  private String title;

  /** 执行器地址类型：0=自动注册、1=手动录入 */
  @Column(name = "address_type", length = 4, nullable = false)
  @Comment(value = "执行器地址类型：0=自动注册、1=手动录入")
  private int addressType = 0;

  /** 执行器地址列表，多地址逗号分隔 */
  @Lob
  @Column(name = "address_list")
  @Comment(value = "执行器地址列表，多地址逗号分隔")
  private String addressList;

  @Column(name = "update_time")
  @Comment(value = "更新时间")
  private Date updateTime;
}
